#include "StdAfx.h"
#include "Device.h"


Device::Device(void)
{
	_Initialized = false;
}

Device::~Device(void)
{
}

HRESULT Device::Init(void)
{
	if (_Initialized)
		return S_OK;
	HRESULT hr = OnInit();
	if (FAILED(hr))
	{
		Uninit();
		return hr;
	}
	_Initialized = true;
	return hr;
}

HRESULT Device::Uninit(void)
{
	if (_Initialized == false)
		return S_OK;
	HRESULT hr = OnUninit();
	ASSERT(hr == S_OK);
	_Initialized = false;
	return hr;
}
